package dao;

import java.util.HashMap;

import org.w3c.dom.Document;

import utility.Util_Trading;

public class GetPopularKeywordsDAO {
	
	public static HashMap<String,String> getPopularKeywordsDAO(String category) {
		
		HashMap<String,String> data=new HashMap<String,String>();
		data.put("CategoryID", category);
		
		Document response = Util_Trading.sendRequest("GetPopularKeywords.txt", data);
		
		String timestamp = response.getElementsByTagName("Timestamp").item(0).getChildNodes().item(0).getNodeValue();
		String categoryID = response.getElementsByTagName("CategoryID").item(0).getChildNodes().item(0).getNodeValue();
		String keywords = response.getElementsByTagName("Keywords").item(0).getChildNodes().item(0).getNodeValue();
		
		
		data = new HashMap<String,String>();
		
		data.put("Timestamp", timestamp);
		data.put("CategoryID", categoryID);
		data.put("Keywords", keywords);
		
		return data;
	}
	
}
 